package com.ph.clouds.tracker.entity;


import com.ph.clouds.tracker.emun.EventEmum;
import com.ph.clouds.tracker.emun.PageEmum;

/**
 * @Author yushuangjiang
 * @Time 2021/8/2 15:00
 * @Description： 埋点数据类
 */
public class TrackParamsEntity {
    String androidId;
    String deviceModel;
    String imei;
    String buryingPointCode;// event id
    long eventTime = 0; // ms
    String pageCode; // page id
    String remark = "";  //备注

    PageEmum page;
    EventEmum event;

    public TrackParamsEntity() {
    }

    public TrackParamsEntity(PageEmum page, EventEmum event, String remark) {
        this.remark = remark;
        this.page = page;
        this.event = event;
    }

    public TrackParamsEntity(PageEmum page, EventEmum event) {
        this.page = page;
        this.event = event;
    }

    public PageEmum getPage() {
        return page;
    }

    public void setPage(PageEmum page) {
        this.page = page;
    }

    public EventEmum getEvent() {
        return event;
    }

    public void setEvent(EventEmum event) {
        this.event = event;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getAndroidId() {
        return androidId;
    }

    public void setAndroidId(String androidId) {
        this.androidId = androidId;
    }

    public String getDeviceModel() {
        return deviceModel;
    }

    public void setDeviceModel(String deviceModel) {
        this.deviceModel = deviceModel;
    }

    public String getImei() {
        return imei;
    }

    public void setImei(String imei) {
        this.imei = imei;
    }

    public String getBuryingPointCode() {
        return buryingPointCode;
    }

    public void setBuryingPointCode(String buryingPointCode) {
        this.buryingPointCode = buryingPointCode;
    }

    public long getEventTime() {
        return eventTime;
    }

    public void setEventTime(long eventTime) {
        this.eventTime = eventTime;
    }

    public String getPageCode() {
        return pageCode;
    }

    public void setPageCode(String pageCode) {
        this.pageCode = pageCode;
    }

    @Override
    public String toString() {
//        return "{" +
//                "\"androidId\":\"" + androidId + "\"" +
//                ", \"deviceModel\":\"" + deviceModel + "\"" +
//                ", \"imei\":\"" + imei + "\"" +
//                ", \"buryingPointCode\":\"" + event.getCaseValue() + "\"" +
//                ", \"eventTime\":\"" + eventTime + "\"" +
//                ", \"pageCode\":\"" + page.getCaseValue() + "\"" +
//                ", \"remark\":\"" + remark + "\"" +
//                '}';

        StringBuilder sb = new StringBuilder();
        sb.append("{\"androidId\":\"");
        sb.append(this.androidId);
        sb.append("\"");
        sb.append(", \"deviceModel\":\"");
        sb.append(this.deviceModel);
        sb.append("\"");
        sb.append(", \"imei\":\"");
        sb.append(this.imei);
        sb.append("\"");
        sb.append(", \"buryingPointCode\":\"");
        sb.append(this.event.getCaseValue());
        sb.append("\"");
        sb.append(", \"eventTime\":\"");
        sb.append(this.eventTime);
        sb.append("\"");
        sb.append(", \"pageCode\":\"");
        sb.append(this.page.getCaseValue());
        sb.append("\"");
        sb.append(", \"remark\":\"");
        sb.append(this.remark);
        sb.append("\"}");

        return sb.toString();
    }

    public String toString1() {
//        return "{" +
//                "\"androidId\":\"" + androidId + "\"" +
//                ", \"deviceModel\":\"" + deviceModel + "\"" +
//                ", \"imei\":\"" + imei + "\"" +
//                ", \"buryingPointCode\":\"" + event.getCaseValue() +"-"+ event.getCaseName() + "\"" +
//                ", \"eventTime\":\"" + eventTime + "\"" +
//                ", \"pageCode\":\"" + page.getCaseValue() +"-"+ page.getCaseName() + "\"" +
//                ", \"remark\":\"" + remark + "\"" +
//                '}';

        StringBuilder sb = new StringBuilder();
        sb.append("{\"androidId\":\"");
        sb.append(this.androidId);
        sb.append("\"");
        sb.append(", \"deviceModel\":\"");
        sb.append(this.deviceModel);
        sb.append("\"");
        sb.append(", \"imei\":\"");
        sb.append(this.imei);
        sb.append("\"");
        sb.append(", \"buryingPointCode\":\"");
        sb.append(this.event.getCaseValue());
        sb.append("-");
        sb.append(this.event.getCaseName());
        sb.append("\"");
        sb.append(", \"eventTime\":\"");
        sb.append(this.eventTime);
        sb.append("\"");
        sb.append(", \"pageCode\":\"");
        sb.append(this.page.getCaseValue());
        sb.append("-");
        sb.append(this.page.getCaseName());
        sb.append("\"");
        sb.append(", \"remark\":\"");
        sb.append(this.remark);
        sb.append("\"}");
        return sb.toString();
    }

}
